<!--
 * @Author: zsc
 * @Date: 2022-06-13 21:56:52
 * @LastEditors: zsc
 * @LastEditTime: 2022-06-30 00:38:07
 * @Description:
-->

<template>
  <div class="app-container">
    <el-card class="app-container-tools">
      <div class="app-container-tools-search">

        <el-button type="primary" @click="_search">查询</el-button>
        <el-button type="primary" @click="_reset">重置</el-button>
      </div>

    </el-card>
    <!--    功能-->
    <!--    查询条件-->
    <el-card>
      <!--    表格-->
      <el-table
        ref="tb"
        v-loading="LOADING"
        :data="TABLE_DATA"
        :size="SIZE"
        border
        :height="LIST_HEIGHT"
        style="width: 100%"
        @selection-change="_handleSelectionChange"
      >
        <el-table-column
          type="selection"
          width="55"
        />
        <template v-for="(item) in setting">
          <el-table-column
            v-if="item.key === 'action'"
            :key="item.id"
            :label="item.name"
            :prop="item.key"
            :width="item.value"
            :fixed="item.fixed"
          >
            <template slot-scope="scope">

              <el-button @click="handleEdit(scope.row)">通过</el-button>
              <el-button @click="handleDel(scope.row)">拒绝</el-button>
            </template>

          </el-table-column>
          <el-table-column
            v-else-if="item.key === 'room_display'"
            :key="item.id"
            :label="item.name"
            :prop="item.key"
            :width="item.value"
            :fixed="item.fixed"
          >
            <template slot-scope="scope">
              <span>{{
                scope.row.rooms.reduce((pre,cur)=>{
                  return pre+cur.name+','
                },'')
              }}
              </span>
            </template>

          </el-table-column>
          <el-table-column
            v-else
            :key="item.id"
            :label="item.name"
            :prop="item.key"
            :width="item.value"
          />
        </template>
      </el-table>
      <!--    分页-->
      <pagination />
      <!--    弹窗-->

    </el-card>
  </div>
</template>

<script>
import list from '@/list'
import CompanyClass from '@/models/company-class'
import { inviteIndexGetList } from '@/api/company'
import { companySizeOptions } from '@/list/data'

const companyClass = new CompanyClass()
export default {
  name: 'DeepInterpretationOrder',
  components: { },
  mixins: [list],
  data() {
    return {
      companySizeOptions,
      caseRequestURLType: '',
      scanVisible: false,
      scanId: 0,
      setting: companyClass.list(),
      ATTENDANCE_VISIBLE: false,
      WHERE: {

      }

    }
  },
  created() {
    this.LIST_API = inviteIndexGetList
  },
  mounted() {
  },
  methods: {

    handleEdit(item) {
      console.log('更新')
      this.FORM_TYPE = 'edit'
      this.FORM_VISIBLE = true
      this.FORM_DATA = item
    }

  }
}
</script>
<style lang="scss">
 @import '@/styles/list/index.scss';
</style>
